﻿<nav class="navbar navbar-default" role="navigation">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">ECatalog</a>
    </div>
    <div class="collapse navbar-collapse navbar-ex1-collapse">
        <ul class="nav navbar-nav" id="menu">
            <li>
                @Html.ActionLink("Домой", "Index", "Base")
            </li>
            <li>
                @Html.ActionLink("Статистика", "Statistic", "Admin")
            </li>
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Администрирование<b class="caret"></b></a>
                <ul class="dropdown-menu">
                    @{
                        var admin = @ViewBag.IsAdmin == true ? @ViewBag.IsAdmin : false;
                    }
                    @if (admin)
                    {
                        <li>
                            @Html.ActionLink("Пользователи", "Index", "User")
                        </li>
                        <li>
                            @Html.ActionLink("Организации", "Index", "Organization")
                        </li>
                        <li>
                            @Html.ActionLink("Магазины", "Index", "Shop")
                        </li>
                        <li>
                            @Html.ActionLink("Модели", "Index", "Model")
                        </li>
                        <li>
                            @Html.ActionLink("Размеры", "Index", "Size")
                        </li>
                        <li>
                            @Html.ActionLink("Комплекты", "Index", "Kit")
                        </li>
                        <li>
                            @Html.ActionLink("Акции", "Index", "Offer")
                        </li>
                        <li>
                            @Html.ActionLink("Статистика", "Index", "StatModel")
                        </li>
                         <li>
                            @Html.ActionLink("Настройка сервера", "Index", "ServerConfig")
                        </li>
                    }
                    else
                    {
                        <li>
                            @Html.ActionLink("Модели", "Index", "Model")
                        </li>
                        <li>
                            @Html.ActionLink("Размеры", "Index", "Size")
                        </li>
                        <li>
                            @Html.ActionLink("Комплекты", "Index", "Kit")
                        </li>
                        <li>
                            @Html.ActionLink("Акции", "Index", "Offer")
                        </li>
                    }

                </ul>
            </li>
        </ul>
        <ul class="nav navbar-nav navbar-right">
            @if (User.Identity.IsAuthenticated)
            {
                <li>
                    <a href="#" style="font-weight: bold;">
                        <span>Здравствуйте,</span>@User.Identity.Name
                    </a>
                </li>
                <li>
                    @Html.ActionLink("Выйти", "LogOff", "User")
                </li>
            }

        </ul>
    </div>
</nav>
